node '%(SHORTHOSTNAME)s' {

  class cls_%(SHORTHOSTNAME)s_network {
    setupNetwork {network:
      hostname => "%(FQDN)s",
    }
    
    setupDNS {dns:
      dns=>["%(DNS)s"],
      searchdomain=>["%(DOMAINNAME)s"],
    }

    setupEth {eth0:
      device=>"eth0",
      bootproto=>"static",
      netmask=>"%(PUBLICNETMASK)s",
      ipaddr=>"%(PUBLICIP)s",
      gateway=>"%(GATEWAY)s",
    }
    
    setupEth {eth1:
      device=>"eth1",
      bootproto=>"static",
      netmask=>"%(PRIVATENETMASK)s",
      ipaddr=>"%(PRIVATEIP)s",
    }
  }

  include cls_%(SHORTHOSTNAME)s_network

  at3_security { def_%(SHORTHOSTNAME)s_security:
    ethgreen=>"eth1",
    domasq=>true,
    require=>Class["cls_%(SHORTHOSTNAME)s_network"],
  }

  pxe_sl55_64 { def_%(SHORTHOSTNAME)s_pxe:
    datapath=>"/opt/atlastier3cfg/tftp",
    url=>"%(URL)s",
    domainname=>"%(DOMAINNAME)s",
    ksfilepath=>"/opt/atlastier3cfg/ks",
    require=>At3_security["def_%(SHORTHOSTNAME)s_security"],
    dhcpsubnet=>"%(PRIVATESUBNETPREFIX)s.0",
    dhcpnetmask=>"%(PRIVATENETMASK)s",
    dhcpipaddress=>"%(PRIVATEIP)s",
    dhcprange=>"%(PRIVATESUBNETPREFIX)s.200 %(PRIVATESUBNETPREFIX)s.254",
  }

  class { dnsmasq:
    dnsmasqinterfaces => ["eth0","eth1"],
    mydomainname => "%(DOMAINNAME)s",
    require=>At3_security["def_%(SHORTHOSTNAME)s_security"],
  }

  at3_ldapclient{nfs_ldapclient:
    ldapsuffix=>"%(LDAPSUFFIX)s",
    ldapuri=>"ldap://%(LDAPHOSTNAME)s/",
    require=>At3_security["def_%(SHORTHOSTNAME)s_security"],
  }

  at3_nfssrv { nfs_nfs:
    share_root=>["/export/home","/export/condor"],
    clientlist=>["%(NFSCLIENTLIST)s"],
    require=>At3_security["def_%(SHORTHOSTNAME)s_security"],
  }

  at3_ganglia_srv { nfs_ganglia_srv:
    clustername => "%(CLUSTERNAME)s",
    clientlist => [%(GANGLIACLIENTLIST)s],
    require=>At3_security["def_%(SHORTHOSTNAME)s_security"],    
  }
    
#  at3_xrootdnfs { def_%(SHORTHOSTNAME)s_xrootdnfs:
#    fqdnRedirector => "%(HEADHOSTNAME)s", 
#  }    
}
